home *** CD-ROM | disk | FTP | other *** search
/ Quick PC 62 / Quick PC 62.iso / I386 / IIS5_01.CAB / IIS_Variables_VBScript.asp < prev    next >
Encoding:
Text File  |  1998-05-29  |  1.8 KB  |  91 lines

  1. <%@ LANGUAGE = VBScript %>
  2. <% Option Explicit %>
  3.  
  4. <!*************************
  5. This sample is provided for educational purposes only. It is not intended to be 
  6. used in a production environment, has not been tested in a production environment, 
  7. and Microsoft will not provide technical support for it. 
  8. *************************>
  9.  
  10.  
  11. <HTML>
  12.     <HEAD>
  13.         <TITLE>Variable Sample</TITLE>
  14.     </HEAD>
  15.  
  16.     <BODY BGCOLOR="White" TOPMARGIN="10" LEFTMARGIN="10">
  17.  
  18.         <!-- Display header. -->
  19.  
  20.         <FONT SIZE="4" FACE="ARIAL, HELVETICA">
  21.         <B>Variable Sample</B></FONT><BR>
  22.             
  23.         <HR>
  24.         <H3>Integer Manipulation</H3>
  25.  
  26.         <%
  27.             'Declare variable.
  28.             Dim intVar
  29.  
  30.             'Assign the variable an integer value.
  31.             intVar = 5
  32.         %>
  33.  
  34.  
  35.         <P><%= intVar %> + <%= intVar %> = <%= intVar + intVar %></P>
  36.  
  37.  
  38.         <HR>
  39.         <H3>String Manipulation</H3>
  40.  
  41.         <%
  42.             'Declare variable.
  43.             Dim strVar
  44.  
  45.             'Assign the variable a string value.
  46.             strVar = "Jemearl"
  47.         %>
  48.  
  49.         <P>This example was done by    <%= strVar + " Smith" %></P>        
  50.  
  51.  
  52.         <HR>
  53.         <H3>Boolean Manipulation</H3>
  54.  
  55.         <%
  56.             'Declare variable.
  57.             Dim blnVar
  58.  
  59.             'Assign the variable a Boolean value.
  60.             blnVar = true
  61.             
  62.             'Output message based on value.
  63.             If (blnVar) Then
  64.               Response.Write "<P>The Boolean value is True.</P>"
  65.             Else
  66.               Response.Write "<P>The Boolean value is False.</P>"
  67.             End If
  68.         %>
  69.         
  70.         <HR>
  71.         <H3>Date and Time</H3>
  72.  
  73.         <%
  74.             'Declare variable.
  75.             Dim dtmVar
  76.  
  77.             'Assign the variable a value.
  78.             dtmVar = #08 / 27 / 97 5:11:42pm#
  79.         %>
  80.  
  81.         <P>The date and time is <%= dtmVar %>
  82.  
  83.         <%
  84.             'Set the variable to the web server date and time.
  85.             dtmVar = Now()
  86.         %>
  87.  
  88.         <P>The <STRONG>system</strong> date and time is <%= dtmVar %></P>
  89.     </BODY>
  90. </HTML>
  91.